<?php
/**
 * WorkOrder.php
 *
 * @copyright   2023 thingsworld.com.cn - All Rights Reserved
 * @link        http://thingsworld.com.cn/
 * @author      stiffer.chen <chenl@thingsworld.com.cn>
 * @created     2023-04-09 14:32:33
 * @modified    2023-04-09 14:32:33
 *
 */

namespace App\Models\CheckIn;

use App\Models\BaseModel;

class WorkOrder extends BaseModel
{
    protected $table = 'checkin_work_order';
    protected $primaryKey = 'id';

    public $timestamps = false;

    protected $fillable = [
        'checkin_id',
        'work_order_id'
    ];

    public function scopeByWorkOrderId($query, $workOrderId)
    {
        return $query->where('work_order_id', $workOrderId);
    }

    public function work_order()
    {
        return $this->belongsTo(\App\Models\WorkOrder::class);
    }
}